import * as webpack from 'webpack';
import * as CompressionWebpackPlugin from 'compression-webpack-plugin';
import * as merge from 'webpack-merge';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as path from 'path';
import BaseConfig from '../webpack.config';

const config = merge(BaseConfig, {
  mode: 'none',
  plugins: [
    new webpack.DefinePlugin({
      "process.env": {
        NODE_ENV: JSON.stringify('test')
      }
    }),
    new CompressionWebpackPlugin({
      asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: /\.(js|css)/,
      threshold: 1024,
      minRatio: 0.8
    }),
    new HtmlWebpackPlugin({
      template: path.join(__dirname, '../public/index.html'),
      filename: "index.html",
      favicon: path.join(__dirname,'../src/assets/favicon.ico'),
      hash: true,
      path: "http://172.16.0.20:81/qrcode/"
    })
  ]
})

export default config;